<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
    <link rel="stylesheet" href="/css/element.css" />
</head><link rel="stylesheet" href="/css/element.css">

<script src="/js/Vue.js"></script>
<script src="/js/element.js"></script>
<script src="/js/axios.js"></script>
<script src="/js/formDataUtils.js"></script>
<script src="/js/jquery.min.js"></script>
<script type="text/javascript" src="/js/layer.js"></script>
<style>
    #tools .el-card__body {
        padding: 5px 5px 5px 20px;
    }
    .el-link {
        margin-right:8px;
    }
    #tools .el-button {
        padding: 10px 8px 10px 5px;
    }
    #template {
        height:100%;
    }
    /* #search .el-card__body {
        height:40px;
    } */
    #table {
        height:calc(100% - 120px);
    }
    /*翻页样式*/
    .el-pagination {
        margin-top:5px;
    }
    #tools .el-button {
        padding: 10px 8px 10px 5px;
        background-color:whitesmoke !important;
        color: black !important;
        border: none !important;
      }
      .el-form-item label{
        text-align: left !important;
        width: 86px !important;
        vertical-align: middle;
        float: left;
        font-size: 14px;
        color: #606266;
        line-height: 40px;
        padding: 0 12px 0 0;
        -webkit-box-sizing: border-box;
        box-sizing: border-box;
      }
</style>
<div id="template">
    <!--增加系列框-->
    <el-card class="box-card" id="search" >
        <el-form :inline="false" class="demo-form-inline">
          <el-form-item label="所在部门: ">
            <el-input clearable style="width:200px;":value="choosedeptname" :disabled="false"></el-input>
            <el-button size="small" @click="chooseDept" :disabled="btndisabled">选择
            </el-button>
        </el-form-item>
        <el-form-item>
           <template>
               <el-checkbox v-model="isAdmin" @change="handleCheckAdminChange">设为部门管理员</el-checkbox>
           </template>
        </el-form-item>
        <el-form-item>
            <template>
            <el-checkbox v-model="isCanMeeting" @change="handleCheckMeetingChange">设置允许创建评审</el-checkbox>
            </template>
        </el-form-item>
        <el-form-item>
            <template>
            <el-checkbox v-model="isCanReview" @change="handleCheckReviewChange">设置允许创建评审会议</el-checkbox>
            </template>
        </el-form-item>
        </el-form>
</div>
<script>
    Vue.config.productionTip = false;//屏蔽提示信息
    //当前编辑的场景数据
    //var sceneData = {};
    //场景id
    var sceneId;
    var sceneData = parent.sceneData;
    var datetree = parent.datetree;
    var choosewindow = null;
    var vue = new Vue({
        el: "#template",
        data() {
            return {
                btndisabled:false,
                deptid:sceneData.deptid,
                choosedeptname:'',
                choosedeptid:'',
                isAdmin:['false'],
                isCanReview:['false'],
                isCanMeeting:['false'],
            }
        },methods:{
            setParam(){
                // parent.vue.editname = this.name;
                //   parent.vue.senior = this.senior;
                //   parent.vue.subSenior = this.subSenior;
                //   parent.vue.intermediate = this.intermediate;
                //   parent.vue.junior = this.junior;
                //   parent.vue.staff = this.staff;
            },


            handleCheckAdminChange(val) {
                this.isAdmin[0] = val;
                parent.vue.isAdmin[0] = val;
             },
            
             handleCheckMeetingChange(val) {
                this.isCanReview[0] = val;
                parent.vue.isCanReview[0] = val;
             },

             handleCheckReviewChange(val) {
                this.isCanMeeting[0] = val;
                parent.vue.isCanMeeting[0] = val;
             },
          //弹出选择部门窗口
          chooseDept() {
              console.log('.......');
              if(choosewindow){return}
          //场景id赋值
          //打开弹窗
          let that = this;
          that.btndisabled=true;
          choosewindow=layer.open({
              type: 2,
              title: '选择部门',
              shadeClose: false,
              shade: false,
              closeBtn: false,
              maxmin: true, //开启最大化最小化按钮
              area: ['400px', '300px'],
              content: '/dialog/department/choosedept.html',
            //   btn:['选择'],
            //   yes:()=>
            //   {
            //       layer.close(choosewindow);
            //       console.log('选择部门:'+that.choosedeptid);
            //   },
              cancel: function () {
                //that.choosedeptid='';
                //that.choosedeptname='';
                  console.log('cancel...')
               },
              end: () => {
                      //console.log('end...')
                      //parent.vue.choosedeptid = that.choosedeptid;
                      //parent.vue.choosedeptname = that.choosedeptname;
                  //this.searchAllScene();
                  //sceneData = {};
                        }
                });
            },
        
        },
        //因为end方法不会执行所以在这里就监听并且赋值
        watch:{
　              choosedeptid(newVal,oldVal){
                    parent.vue.editdeptid = newVal;
                    //console.log('some guys changed id');
            },
                choosedeptname(newVal,oldVal){
                    parent.vue.editdeptname = newVal;
                    //console.log('some guys changed name');
            }
            },

        filters:{
          deptdesc:function(deptid){
            // if(deptid)
            // {
            //   this.deptdesc=deptid;
            // }
            // else 
            // {
            //   this.deptdesc='无所属';
            // }
			    },
		}

    })
</script>

</html>
